package ar.edu.unq.tpi.uis.tepe3.wicket.panels;

import org.apache.wicket.Page;
import org.apache.wicket.markup.html.link.Link;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.IModel;

import ar.edu.unq.tpi.uis.tepe3.wicket.pages.AccessForGroupFormPage;
import ar.edu.unq.tpi.uis.tepe3.wicket.pages.AccessForUserFormPage;

public class DefaultAccessMenuPanel extends Panel {

	public DefaultAccessMenuPanel(String id, IModel model) {
		super(id, model);
		Link createNewGroupAccessLink = new Link("createNewGroupAccess") {

			@Override
			public void onClick() {
				Page aPage = new AccessForGroupFormPage(getModel());
				setResponsePage(aPage);
			}
		};
		
		add(createNewGroupAccessLink);
		
		Link createNewUserAccessLink = new Link("createNewUserAccess") {

			@Override
			public void onClick() {
				Page aPage = new AccessForUserFormPage(getModel());
				setResponsePage(aPage);
			}
		};
		
		add(createNewUserAccessLink);
	}

}
